﻿<Page x:Class="CentroVentas.Forms.Compras.FrmGenerarCompra"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
      xmlns:tk="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
      xmlns:tkk="clr-namespace:System.Windows;assembly=WPFToolkit"
      xmlns:extoolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"
      mc:Ignorable="d"
      Title="FrmGenerarCompra"
      Loaded="Page_Loaded"
      SizeChanged="Page_SizeChanged"
      d:DesignHeight="768" d:DesignWidth="1024"  
      Background="#0000"
      UseLayoutRounding="False">
    <!--Background="#ECF5EB"-->
    <extoolkit:BusyIndicator IsBusy="False"
                              Name="Busy"
                              BusyContent="Cargando...">
        <ScrollViewer>
            <StackPanel Orientation="Vertical">
                <Grid>
                    <TextBlock Text="Generar compra"
                               FontSize="24"
                               Margin="0,10,20,0"
                               HorizontalAlignment="Right" />
                </Grid>
                <Expander Style="{StaticResource GroupBoxExpander}"
                          Header="Proveedor"
                          IsExpanded="True"
                          Name="ProveedorExp"
                          Margin="15">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="75" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="75" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Column="0"
                                    Grid.Row="0"
                                    HorizontalAlignment="Right">
                            <TextBlock Text="RUT:"
                                       Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Grid.Column="1"
                                    Grid.Row="0"
                                    Orientation="Horizontal"
                                    Margin="0,3">
                            <TextBox Width="120"
                                     MaxLength="12"
                                     Name="txtRutProveedor"
                                     Margin="5,0"
                                     HorizontalAlignment="Left"
                                     KeyDown="txtRutProveedor_KeyDown"
                                     MaxHeight="30"
                                     MaxLines="1" />
                            <Button Name="btnBuscar"
                                    Content="Buscar"
                                    Click="btnBuscarProveedor_Click" />
                        </StackPanel>
                        <!--
                <StackPanel Grid.Column="2"
                            Grid.Row="0"
                            HorizontalAlignment="Right">
                    <TextBlock Text="Buscar:"
                               Margin="0,5,0,0" />
                </StackPanel>
                <StackPanel Grid.Column="3"
                            Grid.Row="0">
                    <Expander Style="{StaticResource GroupBoxExpander}"
                              Header="Proveedor"
                              IsExpanded="False"
                              Name="ProveedorSeleccionar"
                              Margin="15">
                        <StackPanel Orientation="Vertical">
                            <TextBox Name="txtBuscarProveedor" />
                            <DataGrid x:Name="grilla"
                                      ItemsSource="{Binding}"></DataGrid>
                            
                        </StackPanel>                        
                    </Expander>
                </StackPanel>
                -->
                        <StackPanel Grid.Column="0"
                                    Grid.Row="1"
                                    HorizontalAlignment="Right">
                            <TextBlock Text="Nombre:"
                                       Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Grid.Column="1"
                                    Grid.Row="1"
                                    Orientation="Horizontal"
                                    Margin="0,3">
                            <TextBox Width="450"
                                     Name="txtNombreProveedor"
                                     Margin="5,0"
                                     HorizontalAlignment="Left"
                                     IsReadOnly="True" />
                        </StackPanel>
                        <StackPanel Grid.Column="2"
                                    Grid.Row="1"
                                    HorizontalAlignment="Right">
                            <TextBlock Text="Giro:"
                                       Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Grid.Column="3"
                                    Grid.Row="1"
                                    Orientation="Horizontal"
                                    Margin="0,3"
                                    HorizontalAlignment="Left">
                            <TextBox Width="450"
                                     Name="txtGiroProveedor"
                                     Margin="5,0"
                                     HorizontalAlignment="Left"
                                     IsReadOnly="True" />
                        </StackPanel>
                        <StackPanel Grid.Column="0"
                                    Grid.Row="3"
                                    HorizontalAlignment="Right">
                            <TextBlock Text="Direccion:"
                                       Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Grid.Column="1"
                                    Grid.Row="3"
                                    Orientation="Horizontal"
                                    Margin="0,3">
                            <TextBox Width="450"
                                     Name="txtDireccionProveedor"
                                     Margin="5,0"
                                     HorizontalAlignment="Left"
                                     IsReadOnly="True" />
                        </StackPanel>
                        <StackPanel Grid.Column="0"
                                    Grid.Row="4"
                                    HorizontalAlignment="Right">
                            <TextBlock Text="Contacto:"
                                       Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Grid.Column="1"
                                    Grid.Row="4"
                                    Orientation="Horizontal"
                                    Margin="0,3">
                            <TextBox Width="450"
                                     Name="txtContactoProveedor"
                                     Margin="5,0"
                                     HorizontalAlignment="Left"
                                     IsReadOnly="True" />
                        </StackPanel>
                        <StackPanel Grid.Column="2"
                                    Grid.Row="3"
                                    HorizontalAlignment="Right">
                            <TextBlock Text="Correo:"
                                       Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Grid.Column="3"
                                    Grid.Row="3"
                                    Orientation="Horizontal"
                                    Margin="0,3">
                            <TextBox Width="450"
                                     Name="txtCorreoProveedor"
                                     Margin="5,0"
                                     HorizontalAlignment="Left"
                                     IsReadOnly="True" />
                        </StackPanel>
                        <StackPanel Grid.Column="2"
                                    Grid.Row="4"
                                    HorizontalAlignment="Right">
                            <TextBlock Text="Web:"
                                       Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Grid.Column="3"
                                    Grid.Row="4"
                                    Orientation="Horizontal"
                                    Margin="0,3">
                            <TextBox Width="450"
                                     Name="txtWebProveedor"
                                     Margin="5,0"
                                     HorizontalAlignment="Left"
                                     IsReadOnly="True" />
                        </StackPanel>
                        <StackPanel Grid.Column="0"
                                    Grid.Row="5"
                                    HorizontalAlignment="Right">
                            <TextBlock Text="Telefono:"
                                       Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Grid.Column="1"
                                    Grid.Row="5"
                                    Orientation="Horizontal"
                                    Margin="0,3">
                            <TextBox Width="450"
                                     Name="txtTelefonoProveedor"
                                     Margin="5,0"
                                     HorizontalAlignment="Left"
                                     IsReadOnly="True" />
                        </StackPanel>
                        <StackPanel Grid.Column="2"
                                    Grid.Row="5"
                                    HorizontalAlignment="Right">
                            <TextBlock Text="Catalogo:"
                                       Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Grid.Column="3"
                                    Grid.Row="5"
                                    Orientation="Horizontal"
                                    Margin="0,3">
                            <TextBox Width="450"
                                     Name="txtCatalogoProveedor"
                                     Margin="5,0"
                                     HorizontalAlignment="Left"
                                     IsReadOnly="True" />
                        </StackPanel>
                    </Grid>
                </Expander>
                <Expander Style="{StaticResource GroupBoxExpander}"
                          Header="Productos"
                          IsExpanded="True"
                          Name="ProductosExp"
                          Margin="15">
                    <Grid Height="500">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition  Width="230" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition  Height="75" />
                            <RowDefinition  Height="*" />
                        </Grid.RowDefinitions>
                        <Grid Grid.Column="0"
                              Grid.Row="0">
                            <StackPanel Orientation="Horizontal">
                                <StackPanel Orientation="Vertical"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Margin="20,10,20,10">
                                    <TextBlock Text="Buscar" />
                                    <extoolkit:WatermarkTextBox Name="txtProducto"
                                                                 Width="230"
                                                                 Watermark="Presione F2 para buscar..."
                                                                 KeyDown="txtProducto_KeyDown"></extoolkit:WatermarkTextBox>
                                </StackPanel>
                                <!--<StackPanel Margin="150,10,20,10"
                                            Orientation="Horizontal">
                                    <Button Name="btnCrearProducto"
                                            Height="35"
                                            Click="btnCrearProducto_Click">Crear Producto</Button>
                                    <Button Name="btnModificarProducto"
                                            Height="35">Modificar Producto</Button>
                                    <Button Name="btnCantidadProducto"
                                            Height="35">Modificar Cantidad</Button>
                                    <Button Name="btnEliminarProducto"
                                            Height="35">Eliminar Producto</Button>
                                    <Button Name="btnLimpiarLista"
                                            Height="35">Limpiar Lista</Button>
                                </StackPanel>-->
                                <StackPanel Margin="150,10,20,10"
                                            Orientation="Horizontal">
                                    <Menu>
                                        <MenuItem Header="Acciones">
                                            <MenuItem Header="Crear producto"
                                                      Click="btnCrearProducto_Click"/>
                                            <MenuItem Header="Modificar producto" />
                                        </MenuItem>                                        
                                    </Menu>
                                </StackPanel>
                            </StackPanel>
                        </Grid>
                        <Grid Grid.Column="0"
                              Grid.Row="1">
                            <Border BorderThickness="1"
                                    CornerRadius="5"
                                    BorderBrush="Gray"
                                    Name="Borde">
                                <DataGrid Name="GrillaCompra"
                                          ItemsSource="{Binding}"
                                          CanUserReorderColumns="False"
                                          IsReadOnly="True"
                                          Height="400"
                                          CanUserAddRows="False"
                                          CanUserDeleteRows="False"
                                          CanUserResizeColumns="False"
                                          SelectionMode="Single"
                                          SelectionUnit="FullRow" AreRowDetailsFrozen="True" HorizontalScrollBarVisibility="Visible"></DataGrid>
                            </Border>
                        </Grid>
                        <Grid Grid.Column="1"
                              Grid.Row="0"
                              Grid.RowSpan="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            
                            <StackPanel Grid.Column="0"
                                        Grid.Row="0"
                                        Margin="10,90,0,0" d:LayoutOverrides="Margin">
                                <TextBlock x:Name="lblPrecio"
                                           Text="Precio"
                                           FontSize="15"/>
                            </StackPanel>
                            <StackPanel Grid.Column="1"
                                        Grid.Row="0"
                                        Margin="0,90,10,0" d:LayoutOverrides="Margin">
                                <TextBlock x:Name="txtPrecio"
                                           Text="$ 0."
                                           FontSize="15"
                                           FontWeight="Bold"/>
                            </StackPanel>
                            <StackPanel Grid.Column="0"
                                        Grid.Row="1"
                                        Margin="10,20,0,0" d:LayoutOverrides="Margin">
                                <TextBlock x:Name="lblCantidad"
                                           Text="Cantidad:"
                                           FontSize="15"/>
                            </StackPanel>
                            <StackPanel Grid.Column="1"
                                        Grid.Row="1"
                                        Margin="0,20,10,0" d:LayoutOverrides="Margin">
                                <TextBlock x:Name="txtCantidad"
                                           Text="0."
                                           FontSize="15"
                                           FontWeight="Bold"/>
                            </StackPanel>
                            
                            <StackPanel Grid.Row="1"
                                        Grid.Column="0"
                                        Grid.ColumnSpan="2"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom"
                                        Margin="15,-30" Height="22" Width="200" d:LayoutOverrides="Margin">
                                <Button Name="btnAceptarCompra"
                                        Width="200"
                                        Content="Generar compra"
                                        Click="btnAceptarCompra_Click"/>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </Expander>
            </StackPanel>
        </ScrollViewer>
    </extoolkit:BusyIndicator>
</Page>
